//
//  HJAppleICloudStorage.h
//  GoogleLoginICloud
//
//  Created by lx on 2024/1/6.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN


@interface AppleICloudStorage : NSObject

+ (void)setUpKeyValueICloudStoreWithKey:(NSString *)key value:(NSString *)value;
+ (void)setUpKeyValueICloudStoreWithBlock:(void (^__nullable)(NSUbiquitousKeyValueStore *keyValueStore))setKeyValueBlock;
+ (NSString *)getKeyValueICloudStoreWithKey:(NSString *)key;

- (void)writeWithData:(NSData *)data fileName:(NSString *)fileName completion:(void (^__nullable)(NSError * _Nullable error))completion;
- (void)readWithFileName:(NSString *)fileName completion:(void (^__nullable)(NSData * _Nullable fileData, NSError * _Nullable error))completion;
- (void)downloadWithFileName:(NSString *)fileName destinationURL:(NSURL *)destinationURL completion:(void (^__nullable)(NSError * _Nullable error))completion;
- (void)deleteWithFileName:(NSString *)fileName completion:(void (^__nullable)(NSError * _Nullable error))completion;

@end

NS_ASSUME_NONNULL_END
